package com.homevip.core.util;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * Map列表
 * @author ll
 *
 * @param <K>
 * @param <E>
 */
public class MapList<K, E> extends HashMap<K, ArrayList<E>> {

	private static final long serialVersionUID = 1L;

	/**
	 * 增加
	 * @param key
	 * @param entity
	 */
	public void add(K key, E entity) {
		
		ArrayList<E> items = this.get(key);
		if (null == items) {
			
			items = new ArrayList<E>();
			this.put(key, items);
		}
		
		items.add(entity);
	}
}
